package xdu.lz.stage2_design_pattern.chapter5_reader_writer_pattern;

/**
 * readwriteLock pattern
 * reader-writer pattern
 */
public class ReadWriteLockClient {
    public static void main(String[] args) {
        final ShareData shareData = new ShareData(10);
        new WriterWorker(shareData,"abcdefg").start();
        new WriterWorker(shareData,"ABCDEFG").start();
        new ReaderWorker(shareData).start();
        new ReaderWorker(shareData).start();
        new ReaderWorker(shareData).start();
        new ReaderWorker(shareData).start();
        new ReaderWorker(shareData).start();

    }
}
